package com.project.mapper;

import com.github.pagehelper.PageInfo;
import com.project.bean.LinkBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ILinkMapper {
    @Insert("insert into t_link(l_name,l_birthday,l_phone)" +
            "values(#{name},#{birthday},#{phone})")
    public void add(LinkBean linkBean);

    @Delete("delete from t_link where pk_linkId=#{id}")
    public void del(int id);

    @Update("update t_link set l_phone=#{phone} where pk_linkId=#{id}")
    public void update(@Param("id") int id,@Param("phone") String phone);

    @Select("select * from t_link")
    @ResultMap("linkMap")
    public List<LinkBean> findAll();

    @Select("select * from t_link where pk_linkId=#{id}")
    @ResultMap("linkMap")
    public LinkBean findById(int id);

}
